1. Field of Invention
The present invention relates to a method of motion detection. More particularly, the present invention relates to a 3-dimensional (3D) comb filter video decoder in NTSC type.
2. Description of Related Art
In the modern daily life, people can see various events without stepping out from a living place. For example, people can see images of landscape scene, news, or playing program, which are transmitted from the TV station to the TV apparatus. Even further, for the monitoring system of the local community, people at home can see the monitoring image taken by the camera, so as to know the outside status. The foregoing various video systems have their individual function and purpose. However, the video signals should be transmitted from the transmitting side to the receiving side.
The color is basically composed by three primary colors of red (R), green (G), and blue (B). In this manner, when the transmitting side intends to transmit the video image, the color information for R, G, and B are converted into electric signals and the electric signals are transmitted out. However, due to the transmitting bandwidth having its limitation, in order to save the bandwidth, the color information of R, G, and B are transformed into information of luminance (luma) and chroma. For example, the color space of Y(luma)UV(chroma) is an example for transforming the RGB information into luminance and chroma. The relation between the RGB color space and the YUV color space is Y=0.299R+0.587G+0.114B; U=0.493(B−Y); V=0.877(R−Y). In Y equation, the coefficients for R, G, and B are the sensitive level for the human eye to the three primary colors. U and V represent blue and red after the luma is removed. For a white light with R=G=B, the quantity of U and V are both zero, which represents no color.
During the process of transmitting the signals, the chroma data should be modulated into a subcarrier signal and is mixed with the luma data. As a standard made by National Television Standards Committee (NTSC), the Y, U, V information are modulated into a composite video signal of Y+U sin(ωt)+V cos(ωt) and then transmitted, wherein ω=2π(Fsc), and Fsc is the subcarrier frequency.
After receiving the composite video signal at the receiver, the signal is sampled. A comb filter, usually, samples the composite video signal by a frequency with four times of Fsc. As a result, each NTSC horizontal line has 910 sampling points, and an NTSC frame has 525 horizontal lines. The total number of sampling points is 910*525=477750. Since the number of sampling points for the whole image frame is not an integer factor of the number of horizontal lines, a phase difference would occur at the different sampling location.
In general, the most difficult part on the technology in the TV decoder is the separation of the luma signal and the chroma signal. The separation quality of the luma and the chroma would affect the decoding quality of the decoder. For this reason, in the current application with the requirement of high-quality image, the technology of 3D comb filter is taken to achieve the separation of luma and chroma.
When the composite video signal is decoded by the 3D comb filter, the composite video signal is sampled by every 90 degrees of the phase angle. Taking the NTSC as the case, when sampling phases are at 0, 0.5π, π, and 1.5π, the quantities of Y+V, Y+U, Y−V, and Y−U are respectively obtained. FIG. 1 is a drawing, schematically illustrating a portion of sampling result in the frame for the NTSC system. In FIG. 1, the vertical axis is the position x of the horizontal line in the frame, and the horizontal axis is the position y of the pixel in the horizontal line. When the two sampling data are corresponding to the same position but in the adjacent frames, the two sampling points has a separation by 477750 sampling points (factors of 4 with remainder of 2), and then the two phases are just have the difference of 180 degrees. The foregoing sampling relation for the adjacent frames can be shown in FIG. 1, but the vertical axis is treated as the sequence m of the frame, that is, the vertical axis is the time axis.
FIG. 2A is a block diagram, illustrating the conventional 3D comb filter. In FIG. 2A, usually, the 3D comb filter includes inter-frame Y/C separator 210, intra-field Y/C separator 220, that is, 2D comb filter, motion detector 230, memory 240, and mixer 250. The composite video signal 201 is obtained by sampling, wherein Fm+1 represents the composite video signal 201 for the (m+1)th frame. The memory 240 stores the composite video signal 201 and provides the composite video signal 202 and the composite video signal 205, wherein Fm represents the composite video signal for the mth frame. The intra-field Y/C separator 220 receives the composite video signal 205, and uses the space relation between the pixels in the frame Fm to perform the Y/C separation, and then exports the separated video signal 221.
Usually, the separation for the motion video signal is done by using the intra-field Y/C separator 220. However, when the intra-field Y/C separator 220 processes the still video signal, it causes the drawbacks of blur edge. In order to improve the image quality, conventionally, the still video signal is processed by the inter-frame Y/C separator 210. The inter-frame Y/C separator 210 receives the composite video signals for the frames Fm+1 and Fm at the same time, and the timing relation between the corresponding pixels in the adjacent frames Fm+1 and Fm is used for Y/C separation, and then the separated video signal 211 is exported. The motion detector 230 is used to judge whether or not the composite video signal 201 is in motion state or in still state. The conventional motion detector 230 receives the composite video signal 201 and the luminance data 221a that is provided by the separated video signal 221. The luminance data 221a and the composite video signal 201 are used to calculate the difference of luma and chroma between the two frames, which are used to judge the pixel state of motion or still, and then a selection signal 231 is exported. The mixer 250, according to the selection signal 231, selects the separated video signal 221, the separated video signal 211, or the mixed signal by a predetermined ratio, and the exports the separated video signal 251.
The motion detector 230 is the essential part for the 3D comb filter. When an error of treating motion state as the still state, it causes an obvious mistake on the image. However, if most of judgments in conservation manner are treated as the motion state, then the effect of the 3D comb filter is reduced. The convention method for detecting the motion is respectively calculating out Y/C values for the previous frame and the current frame, and comparing the difference. FIG. 2B is a block diagram, illustrating the conventional motion detector for the 3D comb filter. In FIG. 2B, for the NTSC, after the composite video signal 201 goes through the low pass filter (LPF) 260, the data approximate to the luma data 232 can be obtained. The frame buffer 291 causes a delay for the frame and then the luma data 233 for the previous frame is obtained. It is compared for the current luma data 232 with the previous luma data 233 to obtain the luma difference 234. In addition, after the composite video signal 201 goes through the band pass filter (BPF) 270 and a subtraction of the luma data 221a, which is provided by the separated video signal calculated by the intra-field Y/C separator 220, is performed, so as to obtain chroma data 236. The frame buffers 292, 293 are used to have the delay by two frames, so as to obtain the chroma data 238 for the previous second frame. The chroma data 236 is subtracted by the previous second chroma data 238, so at to obtain the chroma difference 239. After the detection circuit 280 obtains the luma difference 234 and the chroma difference 239, the maximum is treated as the motion factor.
Conventionally, when the composite video signal 201 is judged for the motion/still state, quantity of the motion factor is often compared with a predetermined threshold value. If the motion factor is clearly greater than the threshold value, then it is judged as a motion state, in which the detection circuit 280 exports the selection signal 231 to use the intra-field Y/C separator 220. If the motion factor is clearly less than the threshold value, then it is judged to be the still state. The detection circuit 280 exports the selection signal 231 to use the inter-frame Y/C separator 210. The image quality is improved. If the motion factor is around the threshold value, it is improper to determine the motion state or the still state. Usually, the luma data and the chroma data respectively calculated by the intra-field Y/C separator 220 and the inter-frame Y/C separator 210 are mixed by a proper ratio, so as to treat this ambiguous situation. Therefore, if the motion factor is more tending to be difficult in convergence, the ambiguous region is certainly larger. The benefit from the 3D comb filter would be reduced a lot.
In conventional method for detecting the motion, the Y/C data are first calculated by a simple 2D Y/C separation, and then the Y/C data for the current frame is compared with that of the previous frame. According the comparing result, the Y/C data to be exported is determined. Here, it is a dilemma about the question of which one is the first for the chicken or egg. If the 2D Y/C separation process can be performed at the beginning to precisely separate the luma data and the chroma data, the 3D comb filter is then not necessary, and the motion factor is not necessary to be calculated. However, if the calculation for the luma data and the chroma data at the beginning has the error, then it also has the error for calculating the motion factor by using the luma data and the chroma data with error. The precision becomes much poor when the motion factor with error is used to determine the final luma data and the chroma data.